#
#  OSPFv2 test suite Makefile
#

#----------------------------------------------------------- SETUP

.PHONY: clean tests testsuite report

VERSION = 0.2.0
TOPDIR = ../../../../..
DOCDIR = $(TOPDIR)/doc
include $(TOPDIR)/Makefile.common

JAVAC = javac -classpath $(SSFNET_TEST_CLASSPATH)
JAVA  = java  -classpath $(SSFNET_TEST_CLASSPATH)

# This is for the cygwin environment which has trouble with the mix of
# slashes and backslashes... Take care, that the classpath is set correctly!
ifeq ($(OSTYPE), cygwin)
JAVAC = javac
JAVA  = java
endif

all:
	$(MAKE) classes
	$(MAKE) tests

#----------------------------------------------------------- MAKE classes
classes:
	$(JAVAC) *.java

#----------------------------------------------------------- MAKE testsuite

testsuite: 
	(cd testsuite; $(MAKE))

#----------------------------------------------------------- MAKE tests

tests:
	(cd testexamples/4_rtrs_sp; $(MAKE))
	(cd testexamples/4_rtrs_sp_cost1; $(MAKE))
	(cd testexamples/4_rtrs_3_areas; $(MAKE))
	(cd testexamples/3_rtrs_2_areas; $(MAKE))
	(cd testexamples/2_rtrs_twice_con; $(MAKE))
	(cd testexamples/as_boundary; $(MAKE))

#----------------------------------------------------------- MAKE report

report: 
	(cd testsuite; $(MAKE) report)

#----------------------------------------------------------- MAKE report

javadoc: 
	javadoc -classpath $(TOPDIR)/src -private -windowtitle Testsuite -d $(DOCDIR) SSF.OS.OSPFv2.test

#----------------------------------------------------------- MAKE clean
clean:
	rm -f *.class *~ *.bak
	(cd testsuite; $(MAKE) clean)
	(cd testexamples/4_rtrs_sp; $(MAKE) clean)
	(cd testexamples/4_rtrs_sp_cost1; $(MAKE) clean)
	(cd testexamples/4_rtrs_3_areas; $(MAKE) clean)
	(cd testexamples/3_rtrs_2_areas; $(MAKE) clean)
	(cd testexamples/2_rtrs_twice_con; $(MAKE) clean)
	(cd testexamples/as_boundary; $(MAKE) clean)